//
//  ITUserInfo.h
//  InTubePro
//
//  Created by seven on 2019/12/25.
//  Copyright © 2019 seven. All rights reserved.
//

#import "BaseModel.h"
#import "ITMember.h"
@class ITUserInfo;

NS_ASSUME_NONNULL_BEGIN

typedef void (^VerifyLoginBlock)(BOOL loginSuccess,ITUserInfo * IT_NULLABLE userInfo);
/*
 createTime = 1582816590000;
 expire = 31104000;
 gender = 0;
 id = 6045276;
 ip = "123.54.52.59";
 name = "0171****6789";
 newer = 0;
 portrait = "";
 source = app;
 time = 1582894774135;
 token = ZjdiNGVlOGEtMDMwMC00Yjc3LWI0MjgtMzVmOWYxZjY1NzA3;
 */
@interface ITUserInfo : ITMember


IT_PROPERTY_ASSIGN int status;//0：游客；1：注册用户
IT_PROPERTY_ASSIGN int exerciseDays;//用户加入APP的天数（运动天数）

IT_PROPERTY_STRONG NSString *inviterChannel;

IT_PROPERTY_STRONG NSDictionary *memberStatistics;


@property(nonatomic) int inviterId;
@property(nonatomic, copy) NSString *inviterCode;

@property(nonatomic, copy) NSString *mobile;

@property(nonatomic, copy) NSString *fbAccount;

@property(nonatomic, strong) ITAccount *account;

/**绑定信息*/
@property(nonatomic, strong) NSMutableArray *binds;

/**绑定账号信息*/
@property(nonatomic, strong) NSMutableArray *accounts;

@property(nonatomic) BOOL isNewer;

@property(nonatomic) BOOL isNewerForAnalyse; //统计时判定是否是新用户

@property(nonatomic, copy) NSString *token;

@property(nonatomic, copy) NSString *source;
@property(nonatomic) NSTimeInterval expire;

IT_PROPERTY_ASSIGN int isScore;//0未评分，1评分，未评分的用户需要在提现时弹窗

IT_PROPERTY_ASSIGN int targetStep;//目标步数

IT_PROPERTY_ASSIGN int step;//今日步数

IT_PROPERTY_ASSIGN int distance;//运动距离(米)
IT_PROPERTY_ASSIGN int duration;//持续时间（分钟）
IT_PROPERTY_ASSIGN int calorie;//消耗卡路里（cal卡）

IT_PROPERTY_STRONG NSString *taskId;
IT_PROPERTY_ASSIGN int pf;

@property(nonatomic, copy) NSString *adSource;

/**
 字典初始化对象
 @param dic 用户信息字典
 @return 用户对象
 */
-(instancetype)initWithDictionary:(NSDictionary *)dic;


/**
 将用户对象转义成字典
 @return 用户信息字典
 */
-(NSDictionary *)dictionaryInfo;

- (BOOL)isGuest;

+ (NSString *)genderStringWithType:(SexType)type;

-(BOOL)isCompleteBodyData;
@end

NS_ASSUME_NONNULL_END
